import songListStore from "../../store/songList";

// components/songRecommend/songRecommend.js
Component({
  properties: {
    songs: {
      type: Array,
      value: []
    }
  },
  methods: {
    songClick(event) {
      // console.log(event);
      const songInfo = event.currentTarget.dataset.songinfo
      const id = songInfo.id
      console.log(songInfo);
      const list = event.currentTarget.dataset.list
      const index = event.currentTarget.dataset.index
      // 存入store
      songListStore.setState("list", list)
      songListStore.setState("index", index)
      wx.navigateTo({
        url: `/pages/musicPlayer/musicPlayer?id=${id}`,
      })
    }
  }
})